chore: Let rustfmt format code in doc comments#1125
Conversation
e4340c1 to
282a975
Compare
rustfmt added trailing whitespaces, which collided with the trailing-whitespace check
|
Well we have a problem... rustfmt adds trailing whitespaces (which arguably isn't great). |
They were there on purpose. Too bad we have to remove them to avoid these weird spaces being inserted... |
|
I looked through the diff again. Yes, the removed empty lines aren't great, but in my opinion the benefits of the formatted code snippets by far outweigh that. |
|
Yes, I agree. I just hope this feature improves in the future or there will be more granular control over this. |
|
Merging to get this in (and potentially cut a release). #1130 will fix the pre-commit |
Enable
format_code_in_doc_commentsand letcargo +nightly-2025-10-23 fmt --allformat the code.The unstable feature isn't perfect, but in my opinion this is a significant improvement.